package com.jdjw.modules.thirdpost.param;

import lombok.Getter;

@Getter
public enum WgEnum {

    WG_WS(1, "卫生保洁"),
    WG_PC(2, "普查调查"),
    WG_SG(3, "施工"),
    WG_ZX(4, "秩序维护"),
    WG_YX(5, "夜巡执勤"),
    WG_XF(6, "消防安全"),
    WG_SD(7, "水电工"),
    WG_MG(8, "木工"),
    WG_NG(9, "泥工"),
    WG_SJ(10, "石匠"),
    WG_YQ(11, "油漆"),
    WG_HY(12, "会议用工"),
    WG_QT(13, "其他");


    private Integer code;
    private String msg;

    WgEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static WgEnum getEnumType(Integer code) {
        for (WgEnum value : WgEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public static String getMsgByCode(Integer code) {
        for (WgEnum value : WgEnum.values()) {
            if (value.getCode().equals(code)) {
                return value.getMsg();
            }
        }
        return null;
    }

    public static Integer getCodeByMsg(String msg) {
        for (WgEnum value : WgEnum.values()) {
            if (value.getMsg().equals(msg)) {
                return value.getCode();
            }
        }
        return null;
    }
}
